

<%@ page import="givenchy.TaskGroup" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'taskGroup.label', default: 'TaskGroup')}" />
        <title>修改任务组</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">首页</a></span>
            <span class="menuButton"><g:link class="list" action="list">返回列表</g:link></span>
        </div>
        <div class="body">
            <h1>修改任务组</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${taskGroupInstance}">
            <div class="errors">
                <g:renderErrors bean="${taskGroupInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${taskGroupInstance?.id}" />
                <g:hiddenField name="version" value="${taskGroupInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="name">名称</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'name', 'errors')}">
                                    <g:textField name="name" value="${taskGroupInstance?.name}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                  <label for="description">描述</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'description', 'errors')}">
                                    <g:textField name="description" value="${taskGroupInstance?.description}" />
                                </td>
                            </tr>
                          
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="hourRate">时间限定</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'hourRate', 'errors')}">
                                    <font size="2" color="blue"> 24小时，每一小时希望的点击量</font>
                                    <input type="hidden" name="hourRate" value="">
                                    <table>
                                        <tr>   
                                           <g:each in="${taskGroupInstance.hourRate.split(',')}" var="hour" status="i">
                                                <g:if test="${i < 12}">
                                               <td  style="padding: 0">
                                                 <input type="text" name="rate" class="rate" value="${hour?(hour as Integer):0}" size="4" style="width:30px;">
                                                </td>   
                                                </g:if>
                                           </g:each>
                                        </tr> 
                                        <tr> 
                                            <g:each in="${0..11}" var="hour">
                                                   <td>
                                                    ${hour}点
                                                    </td> 
                                               </g:each> 
                                        </tr>
                                        <tr>   
                                           <g:each in="${taskGroupInstance.hourRate.split(',')}" var="hour" status="i">
                                                <g:if test="${i > 11}">
                                               <td  style="padding: 0">
                                                 <input type="text" name="rate" class="rate" value="${hour?(hour as Integer):0}" size="4" style="width:30px;">
                                                </td>   
                                                </g:if>
                                           </g:each>
                                        </tr> 
                                        <tr> 
                                            <g:each in="${12..23}" var="hour">
                                                   <td>
                                                    ${hour}点
                                                    </td> 
                                               </g:each> 
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <g:if test="${loggedInUserInfo(field:'vip').toInteger() > 2}">
                            <tr class="prop">
                                <td valign="top" class="name"><label for="isAd">是否广告组</label></td>
                                <td valign="top" class="value ${hasErrors(taskGroupInstance,field:'isAd','errors')}">
                                    <input type="checkbox" name="isAd" style="border:0px;"/>
                                </td>
                            </tr>


                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="requireOfIP">点击质量</label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: taskGroupInstance, field: 'requireOfIP', 'errors')}">
                                    <g:textField name="requireOfIP" value="${fieldValue(bean: taskGroupInstance, field: 'requireOfIP')}" />小时  <font size="2" color="blue">每次每IP在多少小时之内不能再次点击，最小值为24此项只为广告任务起作用。</font>
                                </td>
                            </tr>
                        </g:if>
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="更新" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
